package cn.whx.hrm.client;

import cn.whx.hrm.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserInfoFactory implements FallbackFactory<UserInfoClient> {
    @Override
    public UserInfoClient create(Throwable cause) {
        return new UserInfoClient() {
            @Override
            public AjaxResult getUserInfo(Long loginId) {
                return AjaxResult.me().setSuccess(false).setMessage("信息获取失败");
            }
        };
    }
}
